def is_leap_year(year):
    """判断是否为闰年"""
    return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)

def get_days_in_month(month, year):
    """获取指定月份的天数"""
    if month in [4, 6, 9, 11]:
        return 30
    elif month == 2:
        return 29 if is_leap_year(year) else 28
    else:
        return 31

def get_next_day_after_tomorrow(year, month, day):
    """计算隔一天的日期"""
    # 输入验证
    if not (1900 <= year <= 2100):
        return "年份超出范围(1900-2100)"
    if not (1 <= month <= 12):
        return "月份超出范围(1-12)"
    
    days_in_month = get_days_in_month(month, year)
    if not (1 <= day <= days_in_month):
        return f"日期超出范围(1-{days_in_month})"
    
    # 计算隔一天的日期
    day += 2  # 跳过明天，直接到后天
    
    # 处理月份和年份的变化
    if day > get_days_in_month(month, year):
        day -= get_days_in_month(month, year)
        month += 1
        if month > 12:
            month = 1
            year += 1
    
    return year, month, day

def format_date(year, month, day):
    """格式化日期输出"""
    return f"{year}年{month}月{day}日"

if __name__ == "__main__":
    try:
        year = int(input("请输入年份(1900-2100): "))
        month = int(input("请输入月份(1-12): "))
        day = int(input("请输入日期: "))
        
        result = get_next_day_after_tomorrow(year, month, day)
        
        if isinstance(result, tuple):
            next_year, next_month, next_day = result
            print(f"输入日期: {format_date(year, month, day)}")
            print(f"隔一天的日期: {format_date(next_year, next_month, next_day)}")
        else:
            print(f"错误: {result}")
    except ValueError:
        print("输入错误: 请输入有效的整数")